# for module compiling
import os
Import('RTT_ROOT')

cwd = str(Dir('#'))
objs = []
list = os.listdir(cwd)

for d in list:
    path = os.path.join(cwd, d)
    if os.path.isfile(os.path.join(path, 'SConscript')):
        objs = objs + SConscript(os.path.join(d, 'SConscript'))

# Add AT32F403_standard_peripheral
objs = objs + SConscript(os.path.join(cwd,'board','Libraries', 'SConscript'))

# Add GD32E10x_standard_peripheral Drivers
objs = objs + SConscript(os.path.join(cwd,'board','AT32F403_Driver', 'SConscript'))

# Add rtt devices driver 
objs = objs + SConscript(os.path.join(cwd,'board','rtt_devices_driver', 'SConscript'))

# Add SEGGER_RTT driver 
objs = objs + SConscript(os.path.join(cwd,'board','SEGGER_RTT', 'SConscript'))

Return('objs')
